package com.homegoods.orderinfodetail.app;

import android.app.Application;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v4.app.FragmentManager;

import com.homegoods.integration.AppLifecycles;
import com.homegoods.integration.ConfigModule;
import com.homegoods.orderinfodetail.Utils.GlideImageLoader;
import com.previewlibrary.ZoomMediaLoader;

import java.util.List;

/**
 * @author QiQi
 * @ClassName: GlobalConfigureation
 * @date 2018/9/22
 * @description
 */
public class GlobalConfiguration implements ConfigModule {
    @Override
    public void applyOptions(Context context) {

    }

    @Override
    public void injectAppLifecycle(Context context, List<AppLifecycles> lifecycles) {
        lifecycles.add(new AppLifecycles() {
            @Override
            public void attachBaseContext(@NonNull Context base) {

            }

            @Override
            public void onCreate(@NonNull Application application) {
                ZoomMediaLoader.getInstance().init(new GlideImageLoader());
            }

            @Override
            public void onTerminate(@NonNull Application application) {

            }
        });
    }

    @Override
    public void injectActivityLifecycle(Context context, List<Application.ActivityLifecycleCallbacks> lifecycles) {

    }

    @Override
    public void injectFragmentLifecycle(Context context, List<FragmentManager.FragmentLifecycleCallbacks> lifecycles) {

    }
}
